package org.eae.eldf.dao.prod.impl;

import java.util.ArrayList;
import java.util.List;

import org.eae.eldf.dao.prod.IProdCategoryDao;
import org.eae.eldf.entity.prod.ProdCategory;
import org.eae.eldf.framework.dao.JdbcDaoImpl;
import org.eae.eldf.framework.pager.Pagination;
import org.eae.eldf.framework.utils.StringUtil;
import org.springframework.stereotype.Repository;

@Repository
public class ProdCategoryDaoImpl extends JdbcDaoImpl implements IProdCategoryDao{

	@Override
	public Pagination<ProdCategory> queryPageList(
			Pagination<ProdCategory> pager, String serachValue) {
		// TODO Auto-generated method stub
		StringBuffer sql = new StringBuffer("SELECT * FROM PROD_CATEGORY T ");
		List<Object> params=new ArrayList<Object>();
		if(!StringUtil.isNullOrBlank(serachValue)){
			sql.append("WHERE T.CREATE_USER = ?");
			params.add(serachValue);
		}
		sql.append(" ORDER BY CREATE_TIME DESC");
		return this.queryListByPage(pager,sql.toString(),params,ProdCategory.class);
	}

	}


